@extends('pc.v3.layouts.newapp')
@push('styles')
  <link rel="stylesheet" href="{{web_static('pc/v3/css/indexmap.min.css',true)}}"/>
@endpush
@section('header')
@endsection
@section('content')
  <div class="map-content">
    <div id="content-map"></div>
    <div class="map-left">
      <div class="map-left-title">
        <div class="map-title-header">
          <div class="map-header-input">
            <input placeholder="输入小区或地址搜索房源"/>
          </div>
          <div class="map-header-search"><i class="icon icon-mapsearch"></i></div>
          <ul class="map-hot-text">
            <li data-lng="" data-lat="" style="cursor:auto;">热门搜索</li>
            @foreach( Common\Define\View\WebMapHot::getItemForCity($city) as $item)
            <li data-lng="{{$item['lng']}}" data-lat="{{$item['lat']}}">{{$item['keyword']}}</li>
            @endforeach
          </ul>
          <ul class="map-hot-positive">
            <li data-lng="" data-lat="" style="cursor:auto;">你可能在找</li>
          </ul>
        </div>
        <div class="map-title-content">
          <div class="map-content-tab tab-region active">区域</div>
          <div class="map-content-tab tab-subway">地铁
            <div class="subway">
              @if(is_array($ditie))
              @foreach($ditie as $k=>$v)<p data-id='{{$v->traffic_id}}'>{{$v->traffic_name}}</p>
              @endforeach
              @endif
              @if(is_array($ditie))
              @foreach($ditie as $k=>$v)
              @if(count($ditie)*32>320 && $k*32+320>count($ditie)*32)<div class="subway-list-content" id="ditie_{{$v->traffic_id}}" style="top:{{count($ditie)*32-320}}px;" onclick="ares_push('map_ditie_line{{$v->traffic_id}}','/','click');">
              @else<div class="subway-list-content" id="ditie_{{$v->traffic_id}}" style="top:{{$k*32}}px;" onclick="ares_push('map_ditie_line{{$v->traffic_id}}','/','click');">
              @endif
              @if(is_array($v->stationList))
              @foreach($v->stationList as $a=>$b)
              @if(($a+1)%10==1)<ul >
              @endif<li data-shortid="{{$b->short_id}}" data-lng="{{$b->gd_lng}}" data-lat="{{$b->gd_lat}}">{{$b->station_name}}<i></i>
              @if(($a+1)%10==1)<span class="first-patch"></span>
              @endif<div class="circle"></div>
              @if(($a+1)%10==0 || count($v->stationList)==($a+1))<span class="last-patch"></span>
              @endif</li>
              @if(($a+1)%10==0  || count($v->stationList)==($a+1))</ul >
              @endif
              @endforeach
              @endif</div>
              @endforeach
              @endif
            </div>
          </div><span class="city">{{$city->name}}市</span>
        </div>
        <div class="map-title-subway">
          <div class="subway-content">一号线</div>
          <div class="subway-choose">重新选择
            <div class="again-subway">
              @if(is_array($ditie))
              @foreach($ditie as $k=>$v)<p id="ditie_select_{{$v->traffic_id}}" data-id="{{$v->traffic_id}}">{{$v->traffic_name}}</p>
              @endforeach
              @endif
              @if(is_array($ditie))
              @foreach($ditie as $k=>$v)
              @if(count($ditie)*32>320 && $k*32+320>count($ditie)*32)<div id="ditie_select_sub_{{$v->traffic_id}}" class="subway-list-again"  style="top:{{count($ditie)*32-320}}px;"   onclick="ares_push('map_ditie1_line{{$v->traffic_id}}','/','click');">
              @else<div id="ditie_select_sub_{{$v->traffic_id}}" class="subway-list-again" style="top:{{$k*32}}px;"   onclick="ares_push('map_ditie1_line{{$v->traffic_id}}','/','click');">
              @endif
              @if(is_array($v->stationList))
              @foreach($v->stationList as $a=>$b)
              @if(($a+1)%10==1)<ul>
              @endif<li id="short_id_{{$b->short_id}}" data-shortid="{{$b->short_id}}" data-lng="{{$b->gd_lng}}" data-lat="{{$b->gd_lat}}">
              {{$b->station_name}}
              <i></i>
              @if(($a+1)%10==1)<span class="first-patch"></span>
              @endif<div class="circle"></div>
              @if(($a+1)%10==0 || count($v->stationList)==($a+1))<span class="last-patch"></span>
              @endif</li>
              @if(($a+1)%10==0  || count($v->stationList)==($a+1))</ul >
              @endif
              @endforeach
              @endif</div>
              @endforeach
              @endif
            </div>
          </div>
        </div>
        <div class="map-title-foot">
          <div class="map-foot-list rent-type"><span>整租/合租</span><i class="icon icon-arrowDown"></i>
            <ul>
              <li data-param="" data-name="整租/合租" onclick="ares_push('map_zhengzuhezu_zhengzuhezu','/','click');">整租/合租</li>
              <li data-param="ENTIRE" data-name="整租" onclick="ares_push('map_zhengzuhezu_zhengzu','/','click');">整租</li>
              <li data-param="SHARE" data-name="合租" onclick="ares_push('map_zhengzuhezu_hezu','/','click');">合租</li>
            </ul>
          </div>
          <div class="map-foot-list rent-price"><span>租金</span><i class="icon icon-arrowDown"></i>
            <ul>
              <li data-min="" data-max="" data-name="租金" onclick="ares_push('map_zujin_buxian','/','click');">不限</li>
              @foreach (\Common\Define\Param\RentPrice::getCityRentPrice($city)::items() as $k=>$v)
              <li data-min="{{$v['min']}}" data-max="{{$v['max']}}" data-name="{{$v['name']}}" onclick="ares_push('map_zujin_{{$k+1}}','/','click');">{{$v['name']}}</li>
              @endforeach
            </ul>
          </div>
          <div class="map-foot-list action rent-direction"><span>朝向</span><i class="icon icon-arrowDown"></i>
            <ul>
              <li data-param="" data-name="朝向" onclick="ares_push('map_chaoxiang_buxian','/','click');">不限</li>
              <li data-param="EAST,EAST_NORTH" data-name="朝东" onclick="ares_push('map_chaoxiang_east','/','click');">朝东</li>
              <li data-param="SOURTH,EAST_SOURTH,WEST_SOURTH" data-name="朝南" onclick="ares_push('map_chaoxiang_south','/','click');">朝南</li>
              <li data-param="WEST,WEST_NORTH" data-name="朝西" onclick="ares_push('map_chaoxiang_west','/','click');">朝西</li>
              <li data-param="NORTH" data-name="朝北" onclick="ares_push('map_chaoxiang_north','/','click');">朝北</li>
            </ul>
          </div>
          <div class="map-choose-clear">清除</div>
        </div>
      </div>
      <div class="map-left-content">
        <div class="map-content-header"><span class="list_order active">默认</span><i class="line">|</i><span class="list_order">租金</span><i class="line">|</i><span class="list_order">面积</span><span style="display:none" class="house-num">找到0套房源</span></div>
        <div class="map-content-ListTatal">
          <div id="hose_list"></div>
          <p class="map-now-down">正在加载中…</p>
          <p style="display: none;" class="map-house-nomore">没有更多房源了</p>
        </div>
        <div class="map-house-none"><img src="{{web_static('pc/v3/assets/map-null.png')}}"/>
          <p>抱歉，暂时没找到您想要的房子</p>
        </div>
      </div>
      <div onclick="ares_push('map_left_xialafu','/','click');" class="map-left-revert"><img src="{{web_static('pc/v3/assets/back.png')}}"/><i class="icon icon-arrowDown"></i></div>
    </div>
    <div class="map-right">
      <div class="map-right-city"><span>{{e($city->name)}}</span><i class="icon icon-arrowDown"></i>
        <ul>
          @foreach(Common\Model\Com\City::getAllCity() as $item)@php $cityUrl = $url->withSubDomain($item->identifier)->withPath('map')->withoutQueryParameter('q')->toString() @endphp
          <a href="{{$cityUrl}}" ><li>{{$item->name}}</li></a>
          @endforeach
        </ul>
      </div><a href="{{url('/')}}" class="map-right-home"><i class="icon icon-mapback"></i><span>返回首页</span></a>
    </div>
    <div id="isz-customer-service" class="map-inquiry"><i class="icon icon-enquire"></i><span>立</span><span>即</span><span>咨</span><span>询</span></div>
  </div>
  <script type="text/javascript">
    //初始变量
    var lng = '{{e($city->lng)}}', lat = '{{e($city->lat)}}', icity = '{{e($city->telephone_code)}}';
    var domin = '{{$city->identifier=='hz'?'www':$city->identifier}}', city_code = '{{e($city->area_code)}}',city_name='{{e($city->name)}}市';
  </script>
@endsection
@section('footer')
@endsection
@push('scripts')
  <script src="//webapi.amap.com/maps?v=1.3&amp;key=41aa4b3719e2d80aa72b27a6615cf526&amp;plugin=AMap.Scale,AMap.Geocoder,AMap.Autocomplete,AMap.Driving,AMap.LineSearch"></script>
  <base href="//webapi.amap.com/ui/1.0/ui/control/BasicControl/examples/"/>
  <script src="//webapi.amap.com/ui/1.0/main.js"></script>
  <script src="{{web_static('pc/v3/js/imap.min.js',true)}}"></script>
@endpush